package com.joker.userExam.controller.scoreManage;

import com.joker.userExam.model.StudentScore;
import com.joker.userExam.service.IScoreManage;
import com.joker.userExam.utils.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 李杰
 * @date 2021/5/9 - 19:44
 */
@CrossOrigin(origins = "http://localhost:3000")
@RestController
@RequestMapping("/scoreManage")
public class ScoreManage {
    @Autowired
    IScoreManage scoreManage;

    @GetMapping("/queryScoreInfo")
    public ResultUtil queryScoreInfo (){
        return scoreManage.queryScoreInfo();
    }

    @GetMapping("/deleteScoreById")
    ResultUtil deleteScoreById(@RequestParam Integer id){
        return  scoreManage.deleteScoreById(id);
    }

    @PostMapping("/queryScoreByCondition")
    ResultUtil queryScoreByCondition(@RequestBody StudentScore studentScore){
        return scoreManage.queryScoreByCondition(studentScore);
    }

}
